﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;
namespace Things.ThingsWeb.CropsProduct
{
    public partial class Show : Page
    {
        public string strid = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (Request.Params["id"] != null && Request.Params["id"].Trim() != "")
                {
                    strid = Request.Params["id"];
                    Guid ProductID = new Guid(strid);
                    ShowInfo(ProductID);
                }
            }
        }

        private void ShowInfo(Guid ProductID)
        {
            Things.BLL.CropsProduct bll = new Things.BLL.CropsProduct();
            Things.Model.CropsProduct model = bll.GetModel(ProductID);

            Things.BLL.Crops cropsBLL = new BLL.Crops();
            Things.Model.Crops crops = cropsBLL.GetModel(model.CropsID);
            this.lblCropsID.Text = crops != null ? crops.CropsName : string.Empty;

            Things.BLL.Factory factoryBLL = new BLL.Factory();
            Things.Model.Factory factory = factoryBLL.GetModel(model.FactoryID);
            this.lblFactoryID.Text = factory != null ? factory.FactoryName : string.Empty;

            this.lblProductDate.Text = model.ProductDate.ToString("yyyy-MM-dd");
            this.lblIsDeleted.Text = model.IsDeleted ? "是" : "否";

        }


    }
}
